package cn.tutou.tw.ck;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppRefField {
    public static void main(String[] args) throws Exception{
        Class<?> C = Class.forName("cn.tutou.tw.ck.Human");
        Object o = C.newInstance();
        Field name = C.getDeclaredField("name");
        name.setAccessible(true);
        name.set(o,"coco");
        Method getName = C.getMethod("getName");
        Object result = getName.invoke(o);
        System.out.println(result);

    }
}
